package opencv;
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import javax.imageio.ImageIO;

public class showEdge
{
    public static BufferedImage meth()throws IOException
    {
        File f=new File("imgg5_21.jpg");
        BufferedImage frame;
        frame=ImageIO.read(f);
        //create the detector
        CannyEdgeDetector detector = new CannyEdgeDetector();

        //adjust its parameters as desired
        detector.setLowThreshold(0.5f);
        detector.setHighThreshold(1f);

        //apply it to an image
        detector.setSourceImage(frame);
        detector.process();
        BufferedImage edges = detector.getEdgesImage();
        return edges;
    }
    
    public static void main()throws IOException
    {
        BufferedImage edges=meth();
        ImageIO.write(edges, "jpg", new File("imgg5_521.jpg"));
        ImageDrawingApplet IDM=new ImageDrawingApplet();
        IDM.main();
    }
}
